/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author shohdi
 */
import java.awt.*;
import java.applet.*;


import java.awt.geom.*;


import java.awt.Rectangle;
import java.awt.Polygon;
import java.awt.image.*;




public class CheckGraphics extends Applet {
    
    BufferedImage bi = new BufferedImage (640,480,BufferedImage.TYPE_4BYTE_ABGR);
    Graphics2D g2d;
    
    AffineTransform identity = new AffineTransform();
    
    
  
    
    public void init()
    {
        this.setSize(640,480);
        g2d = bi.createGraphics();
        
        
    }
    
    
    
    public void update(Graphics g)
    {
        g2d.setColor(Color.BLACK);
        g2d.fill (new Rectangle(0,0,640,480));
        
        g2d.translate(50,50);
        
        
        
        g2d.setColor(Color.ORANGE);
        
        int[] shipX = {-6,-3,-0,3,6,0};
        int[] shipY = {6,7,7,7,6,-7};
        
        
        g2d.fill(new Polygon(shipX,shipY,shipX.length));
        
        
        g2d.translate(100,100);
        g2d.setColor(Color.WHITE);
        g2d.fill(new Polygon(shipX,shipY,shipX.length));
        
        
        paint(g);
        
    }
    
    public void paint (Graphics g)
    {
        g2d.setTransform(identity);
        g2d.setColor(Color.BLACK);
        g2d.fill (new Rectangle(0,0,640,480));
        
        
        
        g2d.translate(50,50);
        
        
        
        g2d.setColor(Color.ORANGE);
        
        int[] shipX = {-6,-3,-0,3,6,0};
        int[] shipY = {6,7,7,7,6,-7};
        
        
        g2d.fill(new Polygon(shipX,shipY,shipX.length));
        
        
        g2d.setTransform(identity);
        
        
        g2d.translate(100,100);
        g2d.setColor(Color.WHITE);
        g2d.fill(new Polygon(shipX,shipY,shipX.length));
        
        g.drawImage(bi, 0, 0, this);
        
        
        
        
        
        
        
        
        
    }
    
    
   public static void main(String[] args)
   {
       
   }
}

